#ifndef HTTPGETTER_H
#define HTTPGETTER_H

#include <QNetworkAccessManager>

QT_BEGIN_NAMESPACE
class QNetworkAccessManager;
class QNetworkReply;
QT_END_NAMESPACE

class HttpGetter : public QObject
{
    Q_OBJECT

public:
    HttpGetter(QObject *parent = 0);
    void startRequest(const QUrl &url);

    QByteArray getImgData() const;
    void setImgData(const QByteArray &value);

signals:
    void dataDownloaded();

private slots:
    void httpFinished();
    void httpReadyRead();

private:
    QNetworkAccessManager qnam;
    QNetworkReply *reply;
    QByteArray imgData;
};

#endif
